<?php

class DB
{
	/*
		Implement the singleton pattern
	*/
	private static $instance;
	public $PDO;
	
	private function __construct()
	{
		try
		{
			$this->PDO = new PDO('mysql:dbname=pablo;host=localhost', 'pablo', 'Ucdn4p');
		}
		catch (PDOException $e)
		{
			echo 'Connection failed: ' . $e->getMessage();
		}
	}
	
	public static function getInstance()
	{
		if (!isset(self::$instance))
		{
			self::$instance = new DB();
		}
		
		return self::$instance;
	}
}

?>